package org.jeecg.modules.alarmRound.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.alarmRound.entity.AlarmRound;

/**
 * @Description: 班次
 * @Author: jeecg-boot
 * @Date:   2023-10-26
 * @Version: V1.0
 */
public interface AlarmRoundMapper extends BaseMapper<AlarmRound> {

    @Select("SELECT * FROM alarm_round WHERE IF(end_time >= start_time,\n" +
            "        CONCAT(CURDATE(), ' ', start_time) <= NOW() AND CONCAT(CURDATE(), ' ', end_time) >= NOW(),\n" +
            "        (CONCAT(CURDATE(), ' ', start_time) <= NOW() OR CONCAT(CURDATE(), ' ', end_time) >= NOW())\n" +
            "    );")
    AlarmRound selectCurrentRound();

}
